<template>
  <div class="el-div">
    <div class="el-div el-s">
      <el-input v-model="input" placeholder="请输入内容" size="mini"></el-input>
    </div>
    <div class="el-div">
      <el-button type="primary" icon="el-icon-search" size="mini"
      >搜索
      </el-button
      >
    </div>
    <div class="el-div">
      <el-button @click="cz" size="mini">重置</el-button>
    </div>
    <div class="el-div">
      <el-button
        type="primary"
        @click="
          tjxm()
        "
        size="mini"
      >添加环境
      </el-button
      >
      <el-dialog :title="title" :visible.sync="dialogFormVisible" width="30%">
        <el-form>
          <el-form-item label="环境名称：" :label-width="formLabelWidth">
            <el-input
              v-model="testName"
              autocomplete="off"
              placeholder="请输入环境名称"
              size="mini"
            ></el-input>
          </el-form-item>
          <el-form-item label="环境备注：" :label-width="formLabelWidth">
            <el-input
              v-model="remark"
              autocomplete="off"
              placeholder="请输入备注"
              size="mini"
            ></el-input>
          </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button @click="dialogFormVisible = false" size="mini"
          >取 消
          </el-button
          >
          <el-button
            type="primary"
            @click="dj()"
            size="mini"
          >确 定
          </el-button
          >
        </div>
      </el-dialog>
    </div>
    <el-table :data="envList.data.list" border size="mini">
      <el-table-column
        type="index"
        label="序号"
        width="80"
        align="center"
      ></el-table-column>
      <el-table-column
        prop="name"
        label="环境名称"
        width="300"
        align="center"
      ></el-table-column>
      <el-table-column
        prop="remark"
        label="备注"
        align="center"
      ></el-table-column>
      <el-table-column
        prop="createTime"
        label="创建时间"
        width="300"
        align="center"
        :formatter="createTimeFormatter"
      ></el-table-column>
      <el-table-column
        prop="updateTime"
        label="更新时间"
        width="300"
        align="center"
        :formatter="updateTimeFormatter"
      ></el-table-column>
      <el-table-column label="操作" align="center" width="200">
        <template slot-scope="scope">
          <el-button size="mini" @click="handleEdit(scope.$index, scope.row)"
          >编辑
          </el-button
          >
          <el-button
            size="mini"
            type="danger"
            @click="handleDelete(scope.$index, scope.row)"
          >删除
          </el-button
          >
        </template>
      </el-table-column>
    </el-table>
    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      layout="total,sizes,prev,pager,next,jumper"
      :page-sizes="[5, 10, 15, 20]"
      :page-size="envList.data.pageSize"
      :current-page="envList.data.pageNumber"
      :total="envList.data.total"
      style="float: right; margin-top: 10px; margin-bottom: 10px"
      :small="true"
    >
    </el-pagination>
  </div>
</template>

<script>
  import index from './index';

  export default index;

</script>
<style>

  @import "index.css";

</style>
